<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<s:if test="totalPage > 0">
<style>
.pagediv{
	text-align:center;
	margin-left:auto;
	margin-right:auto;
	padding-top:5px;
}
.pagediv a{
	text-decoration:none;
}
.pagediv span{
	display: inline-block;
	color:#3594cb;
	width: 35px;
	height: 35px;
	border: 1px solid #e1e2e3;
	background-color: #e1e2e3;
	text-align: center;
	line-height:34px;
}
.pagediv .pupdw:HOVER{
	border-color: #579DFF;
	background-color:#9DCAFF; 
}
.pagediv .pu:HOVER{
	border-color: #579DFF;
	background-color:#9DCAFF; 
}
.pagediv .pzong{
	width: 80px;
	border: 0;
	font-size: 12px;
	background: none;
	color: #999;
}
.pagediv .pupdw{
	width: 80px;
}
.pagediv .pnow{
	color:black;
	border: 0; 
	background: none;
}
</style>
<div class="pagediv">
<s:if test="pageNow>1" >
	<a href='<s:url value="%{url}"><s:param name="pageNow" value="%{pageNow-1 }"></s:param></s:url>'>
	<span class="pupdw">&lt;上一页</span>
	</a>
</s:if>

<c:forEach begin="${pageNow > 5 ? pageNow-5 : 1 }" end="${pageNow > 5 ? (pageNow+5 > totalPage ? totalPage : pageNow+5) : (totalPage < 10)?totalPage:10 }" var="num">
	<c:if test="${num == pageNow}">
		<span class="pnow">${num }</span>
	</c:if>
	<c:if test="${num != pageNow}">
		<a href='<c:url value="${url }"><c:param name="pageNow" value="${num }"></c:param></c:url>'>
			<span class="pu">${num }</span>
		</a>
	</c:if>
</c:forEach>

<s:if test="pageNow<totalPage" >
	<a href='<s:url value="%{url}"><s:param name="pageNow" value="%{pageNow+1 }"></s:param></s:url>'>
	<span class="pupdw">下一页&gt;</span>
	</a>
</s:if>
<span class="pzong">总共${totalPage }页</span>
</div>
</s:if>